package com.xqls.dal.dao.mybatis;

import java.util.List;
import java.util.Map;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Repository;

import com.xqls.dal.dao.RegisterDao;
import com.xqls.dal.model.CompanyExample;
import com.xqls.dal.model.Register;
import com.xqls.dal.model.RegisterExample;
import com.xqls.dal.model.RoleExample;
import com.xqls.dal.service.RegisterMapper;

@Repository
public class RegisterDaoImpl implements RegisterDao{
	
	@Autowired private RegisterMapper registerMapper;

	@Override
	public List<Map<String, Object>> selectByMap(Map<String, Object> map) {
		return registerMapper.selectByMap(map);
	}

	@Override
	public boolean updatRegister(Register register) {
		return registerMapper.updateByPrimaryKeySelective(register)>0;
	}

	@Override
	public boolean insert(Register register) {
		return registerMapper.insertSelective(register)>0;
	}

	@Override
	public Register selectByKey(Integer key) {
		return registerMapper.selectByPrimaryKey(key);
	}

	@Override
	public boolean deleteList(List<Integer> keys) {
		RegisterExample example = new RegisterExample();
		example.createCriteria().andSamplingIdIn(keys);
		return registerMapper.deleteByExample(example)>0;
	}
}
